import Vue from 'vue'
import Router from 'vue-router'
import Index from '../pages/index.vue'
import DetailRouter from './detail'
Vue.use(Router);


const routes = [
  {
    path: '/',
    name: 'index',
    component: Index
  }
];
/**
 * 路由组装方法
 * @param newRouter
 */

assertRouter(DetailRouter);
// 3. 创建 router 实例，然后传 `routes` 配置
export default new Router({
  // mode: 'history',
  routes
})
function assertRouter(newRouter) {
  newRouter.forEach(function (o) {
    routes.push(o);
  })
}
